package mobi.pooper;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.files.FileHandle;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.Sprite;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.scenes.scene2d.Stage;

import static mobi.pooper.Constants.*;

public class GameStage extends Stage {
	private final Pooper pooper;
	private Sprite bgSprite;

	public GameStage(Pooper pooper, float width, float height, boolean stretch) {
		super(width, height, stretch);
		
		this.pooper = pooper;
		
		setBackgroundImage();
	}

	private void setBackgroundImage() {
        bgSprite = new Sprite(Assets.background1, 0, 0, NATIVE_WIDTH, NATIVE_HEIGHT);
        bgSprite.setBounds(0, 0, Assets.background1.getWidth(), Assets.background1.getHeight());    
	}

	public Pooper getPooper() {
		return pooper;
	}

	@Override
	public void draw() {
		SpriteBatch sb = getSpriteBatch();
		sb.begin();
		bgSprite.draw(sb);
		sb.end();
		super.draw();
	}

	@Override
	public void dispose() {
		super.dispose();
	}
}
